<?php

/**
 * @copyright Copyright 2012 CrApache-GUI
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * @license http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 */

function save_to_settings($file){

    $handle = fopen("settings.xml", w);
    fwrite($handle, $file);
    fclose($handle);
}

function set_conf_original_location($location){

    $xml = new SimpleXMLElement("settings.xml", null, true);
    $xml->apache->conf_original = $location;
    save_to_settings($xml->asXML());
}

function set_conf_created_location($location){

    $xml = new SimpleXMLElement("settings.xml", null, true);
    $xml->apache->conf_created = $location;
    save_to_settings($xml->asXML());
}

function get_conf_original_location(){

    $settings = new SimpleXMLElement("settings.xml", null, true);
    $conf = $settings->apache->conf_original;

    return $conf;
}

function get_conf_created_location(){

    $settings = SimpleXMLElement("settings.xml", null, true);
    $conf = $settings->apache->conf_created;

    return $conf;
}

function add_port($port){
}

//set_conf_original_location(80);

?>
